#ifndef KERNEL_KERNEL_H
#define KERNEL_KERNEL_H

#define PARANOID 1

#define TRACE_ARCH 1
#define TRACE_ARCH_DETAILED 1
#define TRACE_MEMORY 1
#define TRACE_MEMORY_DETAILED 1
#define TRACE_SCHEDULER 1
#define TRACE_SCHEDULER_DETAILED 1
#define TRACE_DRIVERS_KEYBOARD 0
#define TRACE_DRIVERS_CONSOLE 0

#include <Mint/Types.h>
#include <Mint/Errors.h>
#include "Interfaces/ITextOutput.h"
#include "Debugger.h"
#include "Memory/MemoryManager.h"
#include "Hal/IHardware.h"
#include "Hal/Memory.h"
#include "Hal/Atomic.h"

#define OS_MAX_NAME_LENGTH	(255)

#ifndef DEBUG
#define DEBUG
#endif

typedef struct KernelArgs_s KernelArgs_t;
typedef struct KernelModule_t KernelModule_t;

struct KernelArgs_s
{
	struct
	{
		uint32 fLower;
		uint32 fUpper;
	} fMemory;

	char * fCommandLine;

	struct
	{
		uint32 fCount;
		KernelModule_t * fFirst;
	} fModules;

	uint16 * fKeymap;
};

struct KernelModule_s
{
	char * fIdentifier;
	void * fData;
	uint32 fLength;
	KernelModule_t * fNext;
};

class CKernel
{
public:
	void Initialize( void );
	void Shutdown( void );
	void Run( void );

	void Panic( const char * message, ... );

	KernelArgs_t * GetArguments() { return &fArguments; }

private:
	void _ParseArgs( void );

private:
	KernelArgs_t fArguments;
};

extern CKernel * Kernel;


#endif // KERNEL_KERNEL_H
